package com.hera.process.config.service.impl;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hera.base.util.FiltroDTO;
import com.hera.process.config.dao.BusinessHourDao;
import com.hera.process.config.domain.BusinessHour;
import com.hera.process.config.domain.BusinessHourPK;
import com.hera.process.config.service.BusinessHourService;

@Service("businesshourService")
public class BusinessHourImpl implements BusinessHourService{

	static final Logger logger = Logger.getLogger(BusinessDayServiceImpl.class);

	@Autowired
	private BusinessHourDao businesshourDao;
	
	
	@Override
	public BusinessHour findById(BusinessHourPK id) {
		
		return businesshourDao.findOne(id);
	}

	@Override
	public void update(BusinessHour entity) {
		
		businesshourDao.save(entity);
	}

	@Override
	public void save(BusinessHour entity) {
		
		businesshourDao.save(entity);
	}

	@Override
	public void delete(BusinessHour entity) {
		
		businesshourDao.delete(entity);
	}

	@Override
	public List<BusinessHour> findAll() {
		
		logger.info("find all");
		return businesshourDao.findAll();
	}

	@Override
	public List<BusinessHour> findAll(FiltroDTO filtroDTO) {
		
		return businesshourDao.obtenerEntidadesPorFiltros(filtroDTO);
	}

}
